package com.cnb.telepathytalk.dto;

import java.io.Serializable;

public class RoomListDTO implements Serializable, InterfaceDTO, Comparable<RoomListDTO> {
	private static final long serialVersionUID = 2L;

	private int index;
	private int type;
	private int firstUcode;
	private String createTime;
	private String title;
	private String lastMsg;
	private String searchWord;
	private int nonReadNum;
	private int age;
	private int gender;
	private int alarm;

	public RoomListDTO() {
		super();
	}

	public RoomListDTO(int index, int type, int firstUcode, String createTime, String title, String lastMsg, String searchWord, int nonReadNum,
			int age, int gender, int alarm) {
		super();
		this.index = index;
		this.type = type;
		this.firstUcode = firstUcode;
		this.createTime = createTime;
		this.title = title;
		this.lastMsg = lastMsg;
		this.searchWord = searchWord;
		this.nonReadNum = nonReadNum;
		this.age = age;
		this.gender = gender;
		this.alarm = alarm;
	}

	public int getAge() {
		return age;
	}

	public int getGender() {
		return gender;
	}

	public boolean getAlarm() {
		return alarm == 0 ? false : true;
	}

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer("");
		sb.append("title : " + title);
		sb.append("    searchWord : " + searchWord);
		return sb.toString();
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public int getFirstUcode() {
		return firstUcode;
	}

	public void setFirstUcode(int firstUcode) {
		this.firstUcode = firstUcode;
	}

	public String getCreateTime() {
		if (createTime == null)
			return "";
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getTitle() {
		if (title == null)
			return "";
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getLastMsg() {
		if (lastMsg == null)
			return "";
		return lastMsg;
	}

	public void setLastMsg(String lastMsg) {
		this.lastMsg = lastMsg;
	}

	public String getSearchWord() {
		if (searchWord == null)
			return "";
		return searchWord;
	}

	public void setSearchWord(String searchWord) {
		this.searchWord = searchWord;
	}

	public int getNonReadNum() {
		return nonReadNum;
	}

	public void setNonReadNum(int nonReadNum) {
		this.nonReadNum = nonReadNum;
	}

	@Override
	public int compareTo(RoomListDTO another) {
		return another.getCreateTime().compareTo(this.createTime);
	}
}
